#!/bin/bash

. config.sh

git config --global user.email "ciyingjue@163.com"
git config --global user.name "jmdvirus"

if [ x"$CM_SOFT" = x"yes" ]; then
    sudo apt install -y vim bless gnome-pie variety gcc g++ git subversion kazam htop autoconf wavemon wireshark php php7.0-curl php7.0-fpm php7.0-gd php7.0-json php7.0-mcrypt php7.0-mbstring php7.0-odbc php7.0-readline php7.0-sqlite3 php7.0-xml php7.0-zip libpcre3-dev libzip-dev unity-tweak-tool mysql-server mysql-client compizconfig-settings-manager compiz-plugins ibus-pinyin ibus-table-wubi openssh-server

    sudo apt-get install -y python-software-properties python-dev

    sudo apt-get install -y libclang-dev vim-python-jedi

    sudo apt install -y expect
fi

if [ x"$CONF_GIT" == x"yes" ]; then
    
    ## Base directory
    TOPDIR=/opt/data/data
    PRIVPROJDIR=$TOPDIR/source/PrivProj
    PROJDIR=$TOPDIR/proj
    
    protocols="https"
    username="jmdvirus"
    password="zhujn1224"
    #urls="git.oschina.net/jmdvirus/ConfigDemo.git"
    urls+=" git.oschina.net/jmdvirus/DemoLang.git"
    urls+=" git.oschina.net/jmdvirus/jkgo.git"
    urls+=" git.oschina.net/jmdvirus/jklibs.git"
    urls+=" git.oschina.net/jmdvirus/jkdocs.git"
    urls+=" git.oschina.net/jmdvirus/jkproject.git"
    
    git_get="git clone $protocols://$username:$password@"
    
    log "Start to git clone projs"
    for url in $urls; do
        projnamelong=${url##*/}
        projname=${projnamelong%.*}
        if [ ! -d $PROJDIR/$projname ]; then
            log "$git_get$url $PROJDIR/$projname"
            $git_get$url $PROJDIR/$projname
            if [ $? -ne 0 ]; then
                exit
            fi
        fi
    done

fi

function install_icons() {
    sudo add-apt-repository ppa:tiheum/equinox
    sudo apt-get update && sudo apt-get install faience-theme faience-icon-theme
    sudo apt-get install faenza-icon-theme
}

function install_themes() {
    echo "nothing now"
}

